package edu.tms.dao;

import java.util.List;
import java.util.Map;

import edu.tms.bean.ClassTeacher;
import edu.tms.crud.JdbcUtil;
import edu.tms.dao.common.CommnonDao;

public class ClassTeacherDaoImpl implements CommnonDao<ClassTeacher>{

	@Override
	public long save(ClassTeacher value) throws Exception {
		return 0;
	}

	@Override
	public int update(ClassTeacher value) throws Exception {
		return 0;
	}

	@Override
	public int delete(ClassTeacher value) throws Exception {
		return 0;
	}

	@Override
	public List<ClassTeacher> findAll(int pageNo, int pageSize)
			throws Exception {
		return null;
	}

	/**
	 * 查询该教师所教授的所有班级
	 * @param tchId
	 * @return
	 * @throws Exception
	 */
	@SuppressWarnings("unchecked")
	public List<ClassTeacher> findAll(Integer tchId)
			throws Exception {
		String sql = "SELECT ci.class_name,ct.class_id,ct.tch_id FROM t_class_teacher ct,t_class_info ci "
				+ "WHERE ct.class_id = ci.class_id AND ct.tch_id = ?";
		return JdbcUtil.query(ClassTeacher.class, sql, tchId);
	}
	@Override
	public List<ClassTeacher> findAll(Object key, int pageNo, int pageSize)
			throws Exception {
		return null;
	}

	@Override
	public ClassTeacher findByKey(Object key) throws Exception {
		return null;
	}

	@Override
	public List<Map<String, Object>> getMapList() throws Exception {
		return null;
	}

}
